<?php
class CreateGalleries extends CakeMigration {

/**
 * Migration description
 *
 * @var string
 * @access public
 */
	public $description = '';

/**
 * Actions to be performed
 *
 * @var array $migration
 * @access public
 */
	public $migration = array(
		'up' => array(
			'create_table' => array(
				'galleries' => array(
				  'id' => array('type'    =>'integer',
									      'null'    => false,
												'key'			=> 'primary'),
					'name' => array('type' => 'string', 'null' => false),
					'created_at' => array('type' => 'timestamp', 'null' => false),
					'created_by'  => array('type' => 'integer', 'null' => false),
				  'indexes' => array(
				      'PRIMARY' => array(
				          'column' => 'id',
				          'unique' => 1),
				  )
				)
			)
		),
		'down' => array(
			'drop_table' => array(
				'galleries'
			),
		),
	);

/**
 * Before migration callback
 *
 * @param string $direction, up or down direction of migration process
 * @return boolean Should process continue
 * @access public
 */
	public function before($direction) {
		return true;
	}

/**
 * After migration callback
 *
 * @param string $direction, up or down direction of migration process
 * @return boolean Should process continue
 * @access public
 */
	public function after($direction) {
		return true;
	}
}
